import java.util.List;

import square.Direction;
import square.Square;
import square.Temperature;


public class Game {

	public static void main(String[] args) {
		new Game();
	}
	
	public Game() {
		createSquareOne();
		createSquareTwo();
		
		printCharacteristics(squareOne, "Square one (before merging) : ");	
		printCharacteristics(squareTwo, "Square two (before merging) : ");	
		
		squareOne.mergeWith(squareTwo, Direction.TWO);
	
		printCharacteristics(squareOne, "Square one (after merging) : ");			
		printCharacteristics(squareTwo, "Square two (after merging) : ");
	}
	
	public void createSquareOne() {
		squareOne = new Square();
			squareOne.setTemperature(150, Temperature.CELCIUS);
			squareOne.setHumidity(59.01);
			squareOne.setMadeOfSlipperyMaterial(true);
			squareOne.addBorders(Direction.ONE,
								Direction.TWO,
								Direction.THREE);
	}
	
	public void createSquareTwo() {
		squareTwo = new Square();
			squareTwo.setTemperature(40, Temperature.CELCIUS);
			squareTwo.setHumidity(89.90);
			squareTwo.setMadeOfSlipperyMaterial(false);
			squareTwo.addBorders(Direction.TWO,
								Direction.THREE,
								Direction.FOUR);
	}
	
	private Square squareOne;
	private Square squareTwo;
	
	public void printCharacteristics(Square square,String header) {
		System.out.println(header);
			System.out.println("temperature : " + "  " + square.getTemperature(Temperature.CELCIUS));
			System.out.println("humidity : " + "  " + square.getHumidity());
			System.out.println("slippery : " + "  " + square.isMadeOfSlipperyMaterial());
			List<Character> borders = square.getBorders();
			for(Character charac : borders) {
				System.out.println("border : " + "  " + charac);
			}
		
		System.out.println(" ");
	}
}
